package com.yfbao.horizon.schedule.tk.sch;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.config.ScheduledTask;
import org.springframework.scheduling.config.ScheduledTaskHolder;
import org.springframework.stereotype.Component;

import java.util.Set;

@Slf4j
@Component
public class ScheduledTaskInfo {

    @Autowired
    private ScheduledTaskHolder scheduledTaskHolder;

    public void printScheduledTasks() {
        Set<ScheduledTask> tasks = scheduledTaskHolder.getScheduledTasks();
        for (ScheduledTask task : tasks) {
            log.info("schedule Task: " + task.toString());
        }
    }


}
